let api = require('./api')

import {fetchOne} from './fetch-one'
import {fetchTwo} from './fetch-two'
let env = require('../env/index')

let baseUrl = env.devBaseUrl

// ----------首页
export function getBannerPort() { //轮播图数据
  return fetchTwo(baseUrl+api.banner,'get', {})
}
export function getCatitemsPort() { //轮播图数据
  return fetchTwo(baseUrl+api.catitems,'get', {})
}
export function getFloorPort() { //轮播图数据
  return fetchTwo(baseUrl+api.floor,'get', {})
}
// ----------分类
export function getMenuPort() { //左侧列表数据
  return fetchTwo(baseUrl+api.catemenu,'get', {})
}
// ----------商品
export function getGoodsPort(query='',cid,pagenum,pagesize) { //商品列表数据
  return fetchTwo(baseUrl+api.goodlist,'get', {query,cid,pagenum,pagesize})
}
// ----------商品详情
export function getGoodsDetailPort(iid) { //商品详情数据
  return fetchTwo(baseUrl+api.goodsdetail,'get', {goods_id:iid})
}

